#-*- coding: utf8 -*-
from tutor.scripts import *
from tutor.plugins.sympy import *

with display_block('Entradas'):
    g = oneof(x * y, x + y, x ** 2 + y ** 2, sqrt(x * y))
    numb = oneof(2, 3, 4, 5, 6)
    func = ((1 + g) ** numb - 1) / g
    point = (0, 0)
    answer = numb
    vars = tuple(var(x) for (x, c) in zip('xyzw', point))

# Salva resposta
g0, g1, g2, g3, g4, g5, g6, g7 = [0] * 8
if answer is None:
    g7 = 1
else:
    locals()['g%s' % answer] = 1
    assert (answer in range(7))
    assert 1 in [ g0, g1, g2, g3, g4, g5, g6, g7 ]

# Mostra resultados
with display_block('Resultados'):
    answers = list(enumerate([ g0, g1, g2, g3, g4, g5, g6, g7 ]))

